function UserManager() {
}

UserManager.resendActivationEmail = function (user_id) {
    $.ajax({
        url: base_url('api/resendActivationEmail'),
        type: 'post',
        data: {user_id: user_id},
        beforeSend: function () {
            noty({type: 'information', text: '正在尝试重新发送激活邮件'});
        },
        success: function (jsonrsp) {
            try {
                var rsp = $.parseJSON(jsonrsp);
                noty({type: rsp.type, text: rsp.message, timeout: 1500, callback: {
                    afterClose: function () {
                        $.noty.closeAll();
                        switch (rsp.type) {
                            case 'success':
                                location.reload();
                                break;
                            default:
                                break;
                        }
                    }
                }});
            } catch (ex) {
                noty({type: 'error', text: '发生内部错误，请联系管理员'});
                throw ex;
            }
        }
    });
};